package spring.yongongsystem.controller.merchant;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.yongongsystem.POJO.dto.GroupPageQueryDTO;
import spring.yongongsystem.result.PageResult;
import spring.yongongsystem.result.Result;
import spring.yongongsystem.service.GroupService;

@RestController("merchantGroupController")
@RequestMapping("/merchant/group")
@Api(tags = "商家小组相关接口")
@Slf4j
public class GroupController {

    @Autowired
    private GroupService groupService;
    /**
     * 小组分页查询
     * @param groupPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("小组分页查询")
    public Result<PageResult> page(GroupPageQueryDTO groupPageQueryDTO){
        log.info("小组分页查询，参数为：{}", groupPageQueryDTO);
        PageResult pageResult = groupService.pageQuery(groupPageQueryDTO);
        return Result.success(pageResult);
    }
}
